import * as tslib_1 from "tslib";
import { Component, Injector, ViewChild, HostBinding, ElementRef } from '@angular/core';
import { BehaviorSubject } from 'rxjs';
import { Form, FrameComponent, FARRIS_DEVKIT_FRAME_PROVIDERS, ViewModel, COMMAND_HANDLERS_TOKEN, FRAME_ID, StateMachine, BindingData, Repository, UIState, Declaration, EXCEPTION_HANDLER, NAMESPACE } from '@farris/devkit';
import { FARRIS_COMMAND_SERVICE_FRAME_PROVIDERS, ComponentManagerService } from '@farris/command-services';
import { KeybindingService } from '@farris/command-services';
import { ActivatedRoute, Router } from '@angular/router';
import { FrmI18nSettingService } from '@gsp-sys/rtf-common';
import { DomSanitizer } from '@angular/platform-browser';
import { ExceptionHandler } from '@farris/command-services';
import { FrameworkSessionService, UriService } from '@farris/bef';
import { FrameworkService } from '@gsp-sys/rtf-common';
import { ApplicationParamService } from '@farris/command-services';
import { EventDeclaration } from '../../events/event';
import { FARRIS_DEVKIT_EXPRESSION_LISTENER_PROVIDERS, FARRIS_DEVKIT_EXPRESSION_EFFECTOR_PROVIDERS } from '@farris/devkit';
import { WFSubmiteService } from '@gsp-wf/rtdevkit';
import { CloudprintService } from '@gsp-svc/cloudprint';
import { WFFlowchartService } from '@gsp-wf/ui-flowchart';
import { TranslateToken, FARRIS_DEVKIT_EXPRESSION_ROOT_FRAME_PROVIDERS } from '@farris/devkit';
import { VerifyDetailService } from '@farris/ui-verify-detail';
import { AppContext, FORM_ID, PARAM_TYPE_TRANSFORM_TOKEN } from '@farris/devkit';
import { BE_SESSION_HANDLING_STRATEGY_TOKEN } from '@farris/bef';
import { BACK_END_MESSAGE_HANDLER_TOKEN } from '@farris/devkit';
import { BackEndMessageHandler } from '@farris/command-services';
import { BefLookupRestService, DefaultComboHttpService } from '@farris/bef';
import { ServerSideToken } from '@farris/ui-lookup';
import { ComboServerSideToken } from '@farris/ui-combo-list';
import { WizardService } from '@farris/ui-wizard';
import { LocalizationService } from "@farris/command-services";
import { QDP_COMMAND_SERVICE_PROVIDERS } from '@qdp/command-services';
import { ConditionDialogComponent, QueryFrameworkLayoutComponent } from '@qdp/query-framework';
import { QdpViewComponent } from '@qdp/spread';
import { RootViewmodel } from '../../viewmodels/rootviewmodel';
import { ROBXDRepository } from '../../models/robxdrepository';
import { LangService } from '../../lang/lang-pipe';
import { RootViewmodelForm } from '../../viewmodels/form/rootviewmodelform';
import { RootViewmodelStateMachine } from '../../viewmodels/statemachine/rootviewmodelstatemachine';
import { RootViewmodelUIState } from '../../viewmodels/uistate/rootviewmodeluistate';
import { Load1Handler } from '../../viewmodels/handlers/load1handler';
import { Search1Handler } from '../../viewmodels/handlers/search1handler';
import { RemoveRows1Handler } from '../../viewmodels/handlers/removerows1handler';
import { Add1Handler } from '../../viewmodels/handlers/add1handler';
import { View1Handler } from '../../viewmodels/handlers/view1handler';
import { Edit1Handler } from '../../viewmodels/handlers/edit1handler';
import { Remove1Handler } from '../../viewmodels/handlers/remove1handler';
import { Filter1Handler } from '../../viewmodels/handlers/filter1handler';
import { submitWithBizDefKey1Handler } from '../../viewmodels/handlers/submitwithbizdefkey1handler';
import { cancelSubmitWithDataId1Handler } from '../../viewmodels/handlers/cancelsubmitwithdataid1handler';
import { ROBXDProxy } from '../../models/robxdproxy';
var RootComponent = /** @class */ (function (_super) {
    tslib_1.__extends(RootComponent, _super);
    function RootComponent(wizardSer, keybindingService, langService, route, router, rootElement, localizationService, frmI18nSettingService, frameworkService, applicationParamsService, verifyService, stateMachine, sanitizer, injector) {
        var _this = _super.call(this, injector) || this;
        _this.wizardSer = wizardSer;
        _this.keybindingService = keybindingService;
        _this.langService = langService;
        _this.route = route;
        _this.router = router;
        _this.rootElement = rootElement;
        _this.localizationService = localizationService;
        _this.frmI18nSettingService = frmI18nSettingService;
        _this.frameworkService = frameworkService;
        _this.applicationParamsService = applicationParamsService;
        _this.verifyService = verifyService;
        _this.stateMachine = stateMachine;
        _this.sanitizer = sanitizer;
        _this.injector = injector;
        _this.cls = 'f-page-root  ';
        _this.lang = "";
        _this.size = {};
        _this.enabledLanguageList = [];
        _this.pageHeaderToolbarToolbarItems = [{
                "id": "button-add",
                "text": _this.langService.transform('button-add', _this.lang, "新增"),
                "resourceId": "button-add",
                "isDP": false,
                "class": "btn-primary",
                "tipsEnable": false,
                "icon": "",
                "children": []
            }, {
                "id": "button-edit",
                "text": _this.langService.transform('button-edit', _this.lang, "编辑"),
                "resourceId": "button-edit",
                "isDP": false,
                "tipsEnable": false,
                "icon": "",
                "children": []
            }, {
                "id": "button-view",
                "text": _this.langService.transform('button-view', _this.lang, "查看"),
                "resourceId": "button-view",
                "isDP": false,
                "tipsEnable": false,
                "icon": "",
                "children": []
            }, {
                "id": "button-delete",
                "text": _this.langService.transform('button-delete', _this.lang, "删除"),
                "resourceId": "button-delete",
                "isDP": false,
                "tipsEnable": false,
                "icon": "",
                "children": []
            }, {
                "id": "button-approve",
                "text": _this.langService.transform('button-approve', _this.lang, "提交审批"),
                "resourceId": "button-approve",
                "isDP": false,
                "tipsEnable": false,
                "icon": "",
                "children": []
            }, {
                "id": "button-cancel-approve",
                "text": _this.langService.transform('button-cancel-approve', _this.lang, "取消提交审批"),
                "resourceId": "button-cancel-approve",
                "isDP": false,
                "tipsEnable": false,
                "icon": "",
                "children": []
            }
        ];
        _this.pageHeaderToolbarToolbarItemsStates = new BehaviorSubject({});
        _this.pageHeaderToolbarToolbarItemsVisibleStates = new BehaviorSubject({});
        _this.tabsToolbarStates = new BehaviorSubject({});
        _this.tabsToolbarVisibleStates = new BehaviorSubject({});
        _this.sectionsToolbarStates = new BehaviorSubject({});
        _this.sectionsToolbarVisibleStates = new BehaviorSubject({});
        _this.querySchemeSection = {
            position: 'inHead',
            contents: []
        };
        _this.SectionqueryschemesectionMainTitle = _this.langService.transform('Section/query-scheme-section/mainTitle', _this.lang, "主标题");
        _this.SectionqueryschemesectionSubTitle = _this.langService.transform('Section/query-scheme-section/subTitle', _this.lang, "");
        _this.QuerySolutionqueryscheme1 = _this.langService.transform('query-scheme-1', _this.lang, "默认筛选方案");
        _this.fieldConfigsqueryscheme1 = [
            {
                "id": "a90bf23c-90e4-4992-bad2-f40bbb012e63",
                "labelCode": "ID",
                "code": "ID",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/a90bf23c-90e4-4992-bad2-f40bbb012e63', _this.lang, "主键"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/a90bf23c-90e4-4992-bad2-f40bbb012e63/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "", "id": "a90bf23c-90e4-4992-bad2-f40bbb012e63", "modalConfig": { "modalCmp": null, "mapFields": null, "showHeader": true, "title": "", "showCloseButton": true, "showMaxButton": true, "width": 800, "height": 600, "showFooterButtons": true, "footerButtons": [] } }
            },
            {
                "id": "d0c053f7-ad20-449d-abb7-9e4b24adc6ba",
                "labelCode": "Version",
                "code": "Version",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/d0c053f7-ad20-449d-abb7-9e4b24adc6ba', _this.lang, "版本"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/d0c053f7-ad20-449d-abb7-9e4b24adc6ba/placeHolder', _this.lang, ""),
                "control": { "controltype": "date", "require": false, "format": "yyyy-MM-dd" }
            },
            {
                "id": "e69d58d5-0101-468f-ae3f-40c76c0f06b0",
                "labelCode": "BillStatus.BillState",
                "code": "BillState",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/e69d58d5-0101-468f-ae3f-40c76c0f06b0', _this.lang, "状态"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/e69d58d5-0101-468f-ae3f-40c76c0f06b0/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "dropdown",
                    "require": false,
                    "valueType": "1",
                    "multiSelect": false,
                    "enumValues": [
                        {
                            "value": "Billing",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/e69d58d5-0101-468f-ae3f-40c76c0f06b0/control/enumValues/Billing', _this.lang, "制单")
                        },
                        {
                            "value": "SubmitApproval",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/e69d58d5-0101-468f-ae3f-40c76c0f06b0/control/enumValues/SubmitApproval', _this.lang, "提交审批")
                        },
                        {
                            "value": "Approved",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/e69d58d5-0101-468f-ae3f-40c76c0f06b0/control/enumValues/Approved', _this.lang, "审批通过")
                        },
                        {
                            "value": "ApprovalNotPassed",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/e69d58d5-0101-468f-ae3f-40c76c0f06b0/control/enumValues/ApprovalNotPassed', _this.lang, "审批不通过")
                        }
                    ]
                }
            },
            {
                "id": "97a41a5a-ad8f-4da3-a430-c8a7f2162135",
                "labelCode": "ProcessInstance.ProcessInstance",
                "code": "ProcessInstance",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/97a41a5a-ad8f-4da3-a430-c8a7f2162135', _this.lang, "流程实例"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/97a41a5a-ad8f-4da3-a430-c8a7f2162135/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "6a00bfbd-5d07-4dbe-9e40-ad6afef4a611",
                "labelCode": "EmployeeID.EmployeeID",
                "code": "EmployeeID",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/6a00bfbd-5d07-4dbe-9e40-ad6afef4a611', _this.lang, "报销人员"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/6a00bfbd-5d07-4dbe-9e40-ad6afef4a611/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "c3777967-af05-4499-b330-d103868dd465",
                "labelCode": "EmployeeID.EmployeeID_Code",
                "code": "Code",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/c3777967-af05-4499-b330-d103868dd465', _this.lang, "编号"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/c3777967-af05-4499-b330-d103868dd465/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "9cda177f-7560-43dc-8136-0b86c6a3534c",
                "labelCode": "EmployeeID.EmployeeID_Name",
                "code": "Name",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/9cda177f-7560-43dc-8136-0b86c6a3534c', _this.lang, "报销人"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/9cda177f-7560-43dc-8136-0b86c6a3534c/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "help",
                    "require": false,
                    "uri": "ROBXD.employeeID_EmployeeID_Name",
                    "textField": "name",
                    "valueField": "name",
                    "idField": "id",
                    "helpId": "915a0b20-975a-4df1-8cfd-888c3dda0009",
                    "displayType": "List",
                    "loadTreeDataType": 'default',
                    "enableFullTree": false,
                    "editable": false,
                    "dialogTitle": _this.langService.transform('QueryScheme/query-scheme-1/9cda177f-7560-43dc-8136-0b86c6a3534c/control/help/dialogTitle', _this.lang, ""),
                    "singleSelect": true,
                    "enableCascade": false,
                    "pageSize": 20,
                    "pageList": "10,20,30,50,100",
                    "nosearch": false,
                    "expandLevel": -1,
                    "context": {
                        "enableExtendLoadMethod": true
                    }
                }
            },
            {
                "id": "8face6fa-55ab-4a8f-ad2d-2e86288cdb3e",
                "labelCode": "DomainID.DomainID",
                "code": "DomainID",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/8face6fa-55ab-4a8f-ad2d-2e86288cdb3e', _this.lang, "所属部门"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/8face6fa-55ab-4a8f-ad2d-2e86288cdb3e/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "7e2086ac-d58f-42d6-8542-a325fd024506",
                "labelCode": "DomainID.DomainID_code",
                "code": "code",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/7e2086ac-d58f-42d6-8542-a325fd024506', _this.lang, "编号"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/7e2086ac-d58f-42d6-8542-a325fd024506/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "33639652-ee0f-4f66-b8b3-7de78de5ebff",
                "labelCode": "DomainID.DomainID_name",
                "code": "name",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/33639652-ee0f-4f66-b8b3-7de78de5ebff', _this.lang, "所属部门"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/33639652-ee0f-4f66-b8b3-7de78de5ebff/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "help",
                    "require": false,
                    "uri": "ROBXD.domainID_DomainID_name",
                    "textField": "name",
                    "valueField": "name",
                    "idField": "id",
                    "helpId": "b524a702-7323-4d46-998e-5ba0c6abcd49",
                    "displayType": "TreeList",
                    "loadTreeDataType": 'default',
                    "enableFullTree": false,
                    "editable": false,
                    "dialogTitle": _this.langService.transform('QueryScheme/query-scheme-1/33639652-ee0f-4f66-b8b3-7de78de5ebff/control/help/dialogTitle', _this.lang, ""),
                    "singleSelect": true,
                    "enableCascade": false,
                    "pageSize": 20,
                    "pageList": "10,20,30,50,100",
                    "nosearch": false,
                    "expandLevel": -1,
                    "context": {
                        "enableExtendLoadMethod": true
                    }
                }
            },
            {
                "id": "c41eab6f-ce34-4920-bf87-434a76b49f7d",
                "labelCode": "BillCode",
                "code": "BillCode",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/c41eab6f-ce34-4920-bf87-434a76b49f7d', _this.lang, "单据编号"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/c41eab6f-ce34-4920-bf87-434a76b49f7d/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "9a3abc0f-8185-4f42-a8b4-8534ab0dd7dd",
                "labelCode": "TotalSum",
                "code": "TotalSum",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/9a3abc0f-8185-4f42-a8b4-8534ab0dd7dd', _this.lang, "报帐金额"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/9a3abc0f-8185-4f42-a8b4-8534ab0dd7dd/placeHolder', _this.lang, ""),
                "control": { "controltype": "number", "require": false, "className": "", "textAlign": "left", "precision": 2, "isBigNumber": false }
            },
            {
                "id": "6c66ce5f-6143-44a8-b3a1-de6bab6bd885",
                "labelCode": "BillType",
                "code": "BillType",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/6c66ce5f-6143-44a8-b3a1-de6bab6bd885', _this.lang, "报销类型"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/6c66ce5f-6143-44a8-b3a1-de6bab6bd885/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "dropdown",
                    "require": false,
                    "valueType": "1",
                    "multiSelect": false,
                    "enumValues": [
                        {
                            "value": "CL",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/6c66ce5f-6143-44a8-b3a1-de6bab6bd885/control/enumValues/CL', _this.lang, "差旅费")
                        },
                        {
                            "value": "JT",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/6c66ce5f-6143-44a8-b3a1-de6bab6bd885/control/enumValues/JT', _this.lang, "交通费")
                        },
                        {
                            "value": "SJ",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/6c66ce5f-6143-44a8-b3a1-de6bab6bd885/control/enumValues/SJ', _this.lang, "手机费")
                        }
                    ]
                }
            },
            {
                "id": "ab442bbe-96fa-4709-b942-a91b6cb54e5f",
                "labelCode": "BillDate",
                "code": "BillDate",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/ab442bbe-96fa-4709-b942-a91b6cb54e5f', _this.lang, "制单日期"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/ab442bbe-96fa-4709-b942-a91b6cb54e5f/placeHolder', _this.lang, ""),
                "control": { "controltype": "date", "require": false, "format": "yyyy-MM-dd" }
            },
            {
                "id": "b93ca002-fdef-4c3c-a65f-049bde5fd54f",
                "labelCode": "ProjectID",
                "code": "ProjectID",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/b93ca002-fdef-4c3c-a65f-049bde5fd54f', _this.lang, "所属项目"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/b93ca002-fdef-4c3c-a65f-049bde5fd54f/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "31a03003-4515-4b1a-a412-adb70bac3e16",
                "labelCode": "ProjectMrg.ProjectMrg",
                "code": "ProjectMrg",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/31a03003-4515-4b1a-a412-adb70bac3e16', _this.lang, "项目经理"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/31a03003-4515-4b1a-a412-adb70bac3e16/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "a67b979f-6fa2-4964-a39d-64f9b8dfc0ae",
                "labelCode": "ProjectMrg.ProjectMrg_Code",
                "code": "Code",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/a67b979f-6fa2-4964-a39d-64f9b8dfc0ae', _this.lang, "编号"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/a67b979f-6fa2-4964-a39d-64f9b8dfc0ae/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "2b937789-21be-4020-8243-50dd3584f0f9",
                "labelCode": "ProjectMrg.ProjectMrg_Name",
                "code": "Name",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/2b937789-21be-4020-8243-50dd3584f0f9', _this.lang, "名称"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/2b937789-21be-4020-8243-50dd3584f0f9/placeHolder', _this.lang, ""),
                "control": { "controltype": "text", "require": false, "className": "" }
            },
            {
                "id": "9769d3ae-4c50-4ee7-8557-a6b9a05b4218",
                "labelCode": "AuditStatus",
                "code": "AuditStatus",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/9769d3ae-4c50-4ee7-8557-a6b9a05b4218', _this.lang, "稽核状态"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/9769d3ae-4c50-4ee7-8557-a6b9a05b4218/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "dropdown",
                    "require": false,
                    "valueType": "1",
                    "multiSelect": false,
                    "enumValues": [
                        {
                            "value": "None",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/9769d3ae-4c50-4ee7-8557-a6b9a05b4218/control/enumValues/None', _this.lang, "未稽核")
                        },
                        {
                            "value": "Passed",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/9769d3ae-4c50-4ee7-8557-a6b9a05b4218/control/enumValues/Passed', _this.lang, "稽核通过")
                        },
                        {
                            "value": "Reject",
                            "name": _this.langService.transform('QueryScheme/query-scheme-1/9769d3ae-4c50-4ee7-8557-a6b9a05b4218/control/enumValues/Reject', _this.lang, "稽核不通过")
                        }
                    ]
                }
            }
        ];
        _this.presetFieldConfigsqueryscheme1 = [
            {
                "id": "9cda177f-7560-43dc-8136-0b86c6a3534c",
                "labelCode": "EmployeeID.EmployeeID_Name",
                "code": "Name",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/9cda177f-7560-43dc-8136-0b86c6a3534c', _this.lang, "报销人"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/9cda177f-7560-43dc-8136-0b86c6a3534c/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "help",
                    "require": false,
                    "uri": "ROBXD.employeeID_EmployeeID_Name",
                    "textField": "name",
                    "valueField": "name",
                    "idField": "id",
                    "helpId": "915a0b20-975a-4df1-8cfd-888c3dda0009",
                    "displayType": "List",
                    "loadTreeDataType": 'default',
                    "enableFullTree": false,
                    "editable": false,
                    "dialogTitle": _this.langService.transform('QueryScheme/query-scheme-1/9cda177f-7560-43dc-8136-0b86c6a3534c/control/help/dialogTitle', _this.lang, ""),
                    "singleSelect": true,
                    "enableCascade": false,
                    "pageSize": 20,
                    "pageList": "10,20,30,50,100",
                    "nosearch": false,
                    "expandLevel": -1,
                    "context": {
                        "enableExtendLoadMethod": true
                    }
                }
            },
            {
                "id": "33639652-ee0f-4f66-b8b3-7de78de5ebff",
                "labelCode": "DomainID.DomainID_name",
                "code": "name",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/33639652-ee0f-4f66-b8b3-7de78de5ebff', _this.lang, "所属部门"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/33639652-ee0f-4f66-b8b3-7de78de5ebff/placeHolder', _this.lang, ""),
                "control": {
                    "controltype": "help",
                    "require": false,
                    "uri": "ROBXD.domainID_DomainID_name",
                    "textField": "name",
                    "valueField": "name",
                    "idField": "id",
                    "helpId": "b524a702-7323-4d46-998e-5ba0c6abcd49",
                    "displayType": "TreeList",
                    "loadTreeDataType": 'default',
                    "enableFullTree": false,
                    "editable": false,
                    "dialogTitle": _this.langService.transform('QueryScheme/query-scheme-1/33639652-ee0f-4f66-b8b3-7de78de5ebff/control/help/dialogTitle', _this.lang, ""),
                    "singleSelect": true,
                    "enableCascade": false,
                    "pageSize": 20,
                    "pageList": "10,20,30,50,100",
                    "nosearch": false,
                    "expandLevel": -1,
                    "context": {
                        "enableExtendLoadMethod": true
                    }
                }
            },
            {
                "id": "ab442bbe-96fa-4709-b942-a91b6cb54e5f",
                "labelCode": "BillDate",
                "code": "BillDate",
                "name": _this.langService.transform('QueryScheme/query-scheme-1/ab442bbe-96fa-4709-b942-a91b6cb54e5f', _this.lang, "制单日期"),
                "placeHolder": _this.langService.transform('QueryScheme/query-scheme-1/ab442bbe-96fa-4709-b942-a91b6cb54e5f/placeHolder', _this.lang, ""),
                "control": { "controltype": "date", "require": false, "format": "yyyy-MM-dd" }
            }
        ];
        _this.lang = localStorage.getItem('languageCode') || "zh-CHS";
        if (_this.frmI18nSettingService) {
            var i18nSetting = _this.frmI18nSettingService.getSetting();
            if (i18nSetting && i18nSetting.languages && i18nSetting.languages.length > 0) {
                i18nSetting.languages.forEach(function (item) {
                    _this.enabledLanguageList.push({
                        code: item.code,
                        name: item.name
                    });
                });
            }
            else {
                console.warn("get current enable languages is null. if this occurs,please ensure the form into the framework.");
                _this.enabledLanguageList.push({ "code": "en", "name": "English" });
                _this.enabledLanguageList.push({ "code": "zh-CHS", "name": "中文简体" });
            }
        }
        return _this;
    }
    RootComponent.prototype.ngOnInit = function () {
        var _this = this;
        if (this.keybindingService) {
            this.viewModel.keybindingMap.forEach(function (keyBinding, method) {
                _this.keybindingService.register(keyBinding, function () {
                    return _this.viewModel[method]();
                });
            });
        }
        this.viewModel.verifycationChanged.subscribe(function (verifyInformations) {
            if (verifyInformations.length) {
                _this.verifyService.createVerify({
                    'parent': _this.rootElement,
                    'verifyList': verifyInformations,
                    'showType': 'all'
                });
            }
            else {
                _this.verifyService.clear();
            }
        });
        this.stateMachine.stateChange.subscribe(function () {
            var pageHeaderToolbarToolbarItemsstates = {
                'button-add': !_this.viewModel.stateMachine['canAdd'],
                'button-edit': !_this.viewModel.stateMachine['canEdit'],
                'button-view': !_this.viewModel.stateMachine['canView'],
                'button-delete': !_this.viewModel.stateMachine['canRemove'],
                'button-approve': !_this.viewModel.stateMachine['canApprove'],
                'button-cancel-approve': !_this.viewModel.stateMachine['canCancelApprove'],
            };
            _this.pageHeaderToolbarToolbarItemsStates.next(pageHeaderToolbarToolbarItemsstates);
        });
        this.stateMachine.stateChange.subscribe(function () {
            var pageHeaderToolbarToolbarItemsvisibleStates = {
                'button-add': true,
                'button-edit': true,
                'button-view': true,
                'button-delete': true,
                'button-approve': true,
                'button-cancel-approve': true,
            };
            _this.pageHeaderToolbarToolbarItemsVisibleStates.next(pageHeaderToolbarToolbarItemsvisibleStates);
        });
        this.pageHeaderToolbarToolbarItems.forEach(function (toolbarItem) {
            var transformText = _this.langService.transform(toolbarItem.resourceId, _this.lang, toolbarItem.text);
            if (transformText) {
                toolbarItem.text = transformText;
            }
        });
        this.applicationParamsService.parseParams(this.route, this.frameworkService, this.viewModel, function () {
            _this.onFormLoad();
        });
    };
    RootComponent.prototype.ngAfterViewInit = function () {
    };
    RootComponent.prototype.ngOnDestroy = function () {
        // 增加表单的自我销毁
        this.context.dispose && this.context.dispose();
        this.viewModel = null;
        this.context = null;
        this.subscription = null;
        this.declaration = null;
        this.wizardSer = null;
        this.keybindingService = null;
        this.langService = null;
        this.route = null;
        this.router = null;
        this.rootElement = null;
        this.localizationService = null;
        this.frmI18nSettingService = null;
        this.frameworkService = null;
        this.applicationParamsService = null;
        this.verifyService.clear();
        this.verifyService = null;
        this.stateMachine = null;
        this.sanitizer = null;
        this.injector = null;
        this.enabledLanguageList = [];
    };
    RootComponent.prototype.handleSizeChange = function (size) {
        this.size = size;
    };
    RootComponent.prototype.onFormLoad = function () {
        this.viewModel.Filter1();
    };
    RootComponent.prototype.pageHeaderToolbarClickHandler = function (args) {
        switch (args.id) {
            case 'button-add':
                this.viewModel.Add1(args);
                break;
            case 'button-edit':
                this.viewModel.Edit1(args);
                break;
            case 'button-view':
                this.viewModel.View1(args);
                break;
            case 'button-delete':
                this.viewModel.Remove1(args);
                break;
            case 'button-approve':
                this.viewModel.submitWithBizDefKey1(args);
                break;
            case 'button-cancel-approve':
                this.viewModel.cancelSubmitWithDataId1(args);
                break;
        }
    };
    tslib_1.__decorate([
        HostBinding('class'),
        tslib_1.__metadata("design:type", Object)
    ], RootComponent.prototype, "cls", void 0);
    tslib_1.__decorate([
        ViewChild(ConditionDialogComponent),
        tslib_1.__metadata("design:type", ConditionDialogComponent)
    ], RootComponent.prototype, "conditionDialog", void 0);
    tslib_1.__decorate([
        ViewChild(QdpViewComponent),
        tslib_1.__metadata("design:type", QdpViewComponent)
    ], RootComponent.prototype, "qdpViewComponent", void 0);
    tslib_1.__decorate([
        ViewChild(QueryFrameworkLayoutComponent),
        tslib_1.__metadata("design:type", QueryFrameworkLayoutComponent)
    ], RootComponent.prototype, "queryFrameworkLayoutComponent", void 0);
    RootComponent = tslib_1.__decorate([
        Component({
            selector: 'app-rootcomponent',
            templateUrl: './rootcomponent.html',
            styleUrls: ['./rootcomponent.scss'],
            providers: [
                FARRIS_DEVKIT_FRAME_PROVIDERS,
                FARRIS_COMMAND_SERVICE_FRAME_PROVIDERS,
                { provide: FRAME_ID, useValue: 'root-component' },
                { provide: BindingData, useClass: BindingData },
                { provide: Repository, useExisting: ROBXDRepository },
                LangService,
                { provide: NAMESPACE, useValue: '' },
                QDP_COMMAND_SERVICE_PROVIDERS,
                { provide: ServerSideToken, useClass: BefLookupRestService },
                { provide: ComboServerSideToken, useClass: DefaultComboHttpService },
                { provide: Form, useClass: RootViewmodelForm },
                { provide: StateMachine, useClass: RootViewmodelStateMachine },
                { provide: UIState, useClass: RootViewmodelUIState },
                FrameworkSessionService,
                UriService,
                ROBXDProxy,
                ROBXDRepository,
                { provide: ViewModel, useClass: RootViewmodel },
                { provide: Declaration, useClass: EventDeclaration },
                { provide: TranslateToken, useExisting: LangService },
                VerifyDetailService,
                { provide: WFSubmiteService, useClass: WFSubmiteService },
                { provide: CloudprintService, useClass: CloudprintService },
                { provide: WFFlowchartService, useClass: WFFlowchartService },
                FARRIS_DEVKIT_EXPRESSION_LISTENER_PROVIDERS,
                FARRIS_DEVKIT_EXPRESSION_EFFECTOR_PROVIDERS,
                FARRIS_DEVKIT_EXPRESSION_ROOT_FRAME_PROVIDERS,
                AppContext,
                ComponentManagerService,
                { provide: PARAM_TYPE_TRANSFORM_TOKEN, useValue: false },
                { provide: FORM_ID, useValue: "5cf0d9dd-5720-4bba-9f7a-fe3d490eb3ca" },
                { provide: BE_SESSION_HANDLING_STRATEGY_TOKEN, useValue: "SeparatedSession" },
                { provide: EXCEPTION_HANDLER, useClass: ExceptionHandler },
                { provide: BACK_END_MESSAGE_HANDLER_TOKEN, useClass: BackEndMessageHandler },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: Load1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: Search1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: RemoveRows1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: Add1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: View1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: Edit1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: Remove1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: Filter1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: submitWithBizDefKey1Handler, multi: true },
                { provide: COMMAND_HANDLERS_TOKEN, useClass: cancelSubmitWithDataId1Handler, multi: true },
            ]
        }),
        tslib_1.__metadata("design:paramtypes", [WizardService,
            KeybindingService,
            LangService,
            ActivatedRoute,
            Router,
            ElementRef,
            LocalizationService,
            FrmI18nSettingService,
            FrameworkService,
            ApplicationParamService,
            VerifyDetailService,
            StateMachine,
            DomSanitizer,
            Injector])
    ], RootComponent);
    return RootComponent;
}(FrameComponent));
export { RootComponent };
